<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="description" content="pear-admin-flask">
  <meta name="keyword" content="pear-admin-flask">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="{{ url_for('static', filename='/index/layui/css/layui.css') }}"/>
  <link rel="stylesheet" href="{{ url_for('static', filename='/index/css/main.css') }}"/>
  <link rel="stylesheet" href="{{ url_for('static', filename='/index/css/load.css') }}"/>
  <style>
      .layui-nav .layui-this:after {
          display: none;
      }

      .layui-nav .layui-nav-bar {
          display: none;
      }
  </style>
  <title>文章</title>
</head>
<body>
<!-- header -->
<div class="ew-header">
  <div class="ew-nav-group">
    <div class="nav-toggle"><i class="layui-icon layui-icon-more-vertical"></i></div>
    <ul class="layui-nav" lay-filter="ew-header-nav">
      {% if client_user %}
        <li class="layui-nav-item">
          <a href="{{url_for('user.get_user_info_index')}}">{{ client_user.realname }}</a>
        </li>
        <li class="layui-nav-item">
          <a href="{{url_for('user.user_logout')}}">注销</a>
        </li>
      {% else %}
        <li class="layui-nav-item">
          <a href="{{ url_for('user.user_login') }}">登录</a>
        </li>
        <li class="layui-nav-item">
          <a href="{{ url_for('user.user_register') }}" target="_blank">注册</a>
        </li>
      {% endif %}
    </ul>
  </div>
</div>
<!-- content -->
<div class="layui-container">
  <fieldset class="layui-elem-field layui-field-title" style="margin-top: 2%">
    <legend>文章</legend>
  </fieldset>
  <div class="intro-box" style="margin-top: 3%">
    <div class="title">
      <h2>{{ result.title }}</h2>
    </div>
    <div class="origin-href" style="margin-top: 1%">
      <blockquote class="layui-elem-quote" style="width: 80%">
        原文链接:<br>
        <a href="{{result.href}}" class="link">{{ result.href }}</a>
      </blockquote>
    </div>
  </div>
  <fieldset class="layui-elem-field" style="margin-top: 5%">
    <legend>正文-内容</legend>
    <div class="layui-field-box">
      <div class="content" id="show-app">
        <iframe
          :src="content"
          width="100%"
          :height="iframeH"
          frameborder="0"
          scrolling="no"
          ref="iframe"
        ></iframe>
      </div>
    </div>
  </fieldset>
  <fieldset class="layui-elem-field" style="margin-top: 3%">
    <legend>附件</legend>
    <div class="layui-field-box">
        附件
    </div>
  </fieldset>
</div>
<script>
    window.content_href = '{{result.content}}'
</script>
</body>

<script src="{{ url_for('static',filename='vue/vue2.6.js') }}"></script>
<script src="{{ url_for('static',filename='axios/axios.min.js') }}"></script>
<script>
    Vue.config.delimiters = ['{[', ']}']
    Vue.prototype.$axios = axios
    new Vue({
        delimiters: ['{[', ']}'],
        el: '#show-app',
        data(){
            return{
                content:'',
                iframeH:'',
                href:'spider/index/result',
            }
        },
        methods: {
          initArticle(){
              this.content=window.location.protocol+"//"+window.location.host+'/'+window.content_href;
          }
        },
        created() {

        },
        mounted(){
            this.initArticle()
          let timer = setTimeout(()=>{
            this.$nextTick(()=>{ // 必须在页面加载完成之后获取高
              // iframe自适应高
              this.iframeH = this.$refs.iframe.contentWindow.document.documentElement.scrollHeight || this.$refs.iframe.contentWindow.document.body.scrollHeight
            })
          }, 300)
          // 清除定时器
          this.$once('hook:beforeDestroy',()=>{
            clearInterval(timer);
            timer = null;
          })
        },
    })
</script>
</html>

<style>
  .title {
        font-weight: 550 !important;
        color: #00B0FF !important;
        display: inline-block !important;
        line-height: 60px !important;
    }
  .link{
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
  }
</style>





